package com.example.webbrowser.Adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.webbrowser.Fragment.ItFragment;
import com.example.webbrowser.Fragment.TechFragment;
import com.example.webbrowser.Fragment.YuleFragment;


public class FragmentAdapter extends FragmentStateAdapter {

    public FragmentAdapter(FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @Override
    public Fragment createFragment(int position) {
        switch (position) {
            case 0:
                return new YuleFragment();
            case 1:
                return new ItFragment();
            default:
                return new TechFragment();
        }
    }

    @Override
    public int getItemCount() {
        return 3;
    }
}
